package com.emm.yixun.jobs;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.emm.yixun.common.app.base.CommonResDTO;
import com.emm.yixun.common.response.Response;
import com.emm.yixun.system.service.NoticeServiceFacade;

/***
 * 员工关怀
 * 描述:
 * 	员工生日提醒,提前7天(后台设置)通知销售组所有人
 *  客户生日当天提醒
 *  客户纪念日提醒,提前X天(后台设置)通知经纪人
 *  客户纪念日当天提醒
 */
@Component
public class UserCareJob {
	 private static Logger logger = LoggerFactory.getLogger(UserCareJob.class);

	 @Autowired
	 private NoticeServiceFacade noticeServiceFacade;
	 
	@Scheduled(cron="${quartz.cron.userCareJob}")
     public void customerCareNotice(){
    	 logger.info("员工关怀消息创建 job start..........");
    	 Response<CommonResDTO> response = noticeServiceFacade.userCareNotice();
    	 if (response.isSuccess()) {
  			logger.info("..........员工关怀消息创建成功..........");
  		 } else {
  			logger.info("..........员工关怀消息创建失败..........");
  		 }
    	 logger.info("员工关怀消息创建 job end..........");
     }

}
